<template>
  <div class="bg">
    <!-- 头部 -->
    <Header title="运维管理—巡检计划"></Header>

    <!-- 搜索栏 -->
    <section class="search_bar">
      <LInput label="计划名称" v-model="name" style="margin-left: 20px"></LInput>
      <LSelect label="启用状态" :value="type" :options="option1" @selected-event="getNewSelected"></LSelect>
      <LButton label="+新增" style="margin-left: 16px" @click="repairDialog = true"></LButton>
      <LButton label="查询数据" style="margin-left: 16px"></LButton>
      <LButton label="重置条件" style="margin-left: 16px" @click="clearSelected"></LButton>
    </section>
    <!-- 表格 -->
    <el-table :data="tData" style="width: 100%" border :default-sort="{prop:'a',order:'ascending'}" ref="table">
      <el-table-column prop="a" label="计划编码" width="180" sortable />
      <el-table-column prop="b" label="计划名称" width="180" />
      <el-table-column prop="c" label="巡检部门" />
      <el-table-column prop="d" label="负责人" />
      <el-table-column prop="e" label="开始时间" sortable />
      <el-table-column prop="f" label="结束时间" sortable />
      <el-table-column label="操作" width="360">
        <template #default="scope">
          <el-button type="success" size="mini" @click="repairDialog3 = true">查看</el-button>
          <el-button type="primary" size="mini" @click="repairDialog4 = true">编辑</el-button>
          <el-button type="info" size="mini" @click="stop">停用</el-button>
          <el-button type="info" size="mini" @click="repairDialog5 = true">排班</el-button>
          <!-- <pre>{{scope.row}}</pre> -->
          <el-button type="info" size="mini" @click="toogleExpand(scope.row)">排班记录</el-button>
        </template>
      </el-table-column>
      <el-table-column type="expand" width="1">
        <template #default>
          <div style="padding:3vh">
            <el-table :data="tableData3" style="width: 100%;" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="编码" />
              <el-table-column prop="b" label="名称" />
              <el-table-column prop="g" label="状态" />
              <el-table-column prop="c" label="开始时间" />
              <el-table-column prop="d" label="结束时间" />
              <el-table-column prop="e" label="周期" />
              <el-table-column prop="f" label="单位" />
              <el-table-column label="操作" width="160">
                <template #default>
                  <el-button type="info" size="mini">召回</el-button>
                  <el-button type="success" size="mini">执行人</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </template>
      </el-table-column>
    </el-table>

    <!-- 弹出框：新增 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog" title="新增" width="50%" @close="repairDialogClose">
        <div class="dialog-border">
          <el-form label-width="110px" :model="repairForm" ref="repairFormRef" :rules="repairFormRules" size="small">
            <div class="row-1">
              <el-form-item label="计划编码" prop="no" style="width:100%">
                <el-input v-model="repairForm.no"></el-input>
              </el-form-item>
              <el-form-item label="计划名称" prop="type" style="width:100%">
                <el-input v-model="repairForm.type"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="巡检部门" prop="no" style="width:100%">
                <el-select v-model="repairForm.no">
                  <el-option label="部门1" value="1"></el-option>
                  <el-option label="部门2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="负责人" prop="type" style="width:100%">
                <el-input v-model="repairForm.type"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="预计开始时间" prop="no">
                <el-date-picker v-model="repairForm.no" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="预计结束时间" prop="type" style="width:100%">
                <el-date-picker v-model="repairForm.type" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="周期间隔" prop="no" style="width:100%">
                <el-input v-model="repairForm.no"></el-input>
              </el-form-item>
              <el-form-item label="周期单位" prop="type" style="width:100%">
                <el-select v-model="repairForm.type">
                  <el-option label="日" value="1"></el-option>
                  <el-option label="周" value="2"></el-option>
                  <el-option label="月" value="3"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="有效时长(小时)" prop="no" style="width:100%">
                <el-input v-model="repairForm.no"></el-input>
              </el-form-item>
              <el-form-item label="开始时刻" prop="type" style="width:100%">
                <el-select v-model="repairForm.type">
                  <el-option label="全天" value="1"></el-option>
                  <el-option label="一日多次" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="备注" prop="mark" style="width:100%">
                <el-input v-model="repairForm.mark" type="textarea" :rows="1"></el-input>
              </el-form-item>
            </div>
          </el-form>
          <div class="dialog-border-padding">
            <div style="padding: 1vh 0;text-align:center">已选路线</div>
            <div style="position:relative">
              <el-button type="primary" size="mini" style="position:absolute;right:0vw;bottom:0.5vh" @click="repairDialog1=true">增加</el-button>
            </div>
            <el-table :data="tableData" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="路线编码" />
              <el-table-column prop="b" label="路线名称" />
              <el-table-column prop="c" label="备注" />
              <el-table-column label="操作" width="140">
                <el-button type="success" size="mini">查看</el-button>
                <el-button type="danger" size="mini">删除</el-button>
              </el-table-column>
            </el-table>
            <div style="padding: 1vh 0;text-align:center;margin-top:5vh">已选执行人</div>
            <div style="position:relative">
              <el-button type="primary" size="mini" style="position:absolute;right:0vw;bottom:0.5vh" @click="repairDialog2=true">增加</el-button>
            </div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="姓名" />
              <el-table-column prop="b" label="工号" />
              <el-table-column prop="d" label="联系电话" />
              <el-table-column label="操作" width="80">
                <template #default>
                  <el-button type="danger" size="mini">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairSureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog = false">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框里的弹框1：路线列表 -->
    <div v-dialogdrag class="pop-2">
      <el-dialog v-model="repairDialog1" title="路线列表" width="60%" @close="repairDialog1Close(row)" :rules="repairForm1Rules">
        <el-form ref="repairForm1Ref" :model="repairForm1" label-width="50px" size="small">
          <el-form-item label="搜索" prop="search" style="width: 50%">
            <el-input v-model="repairForm1.search"></el-input>
          </el-form-item>
        </el-form>
        <el-table :data="subTable1" style="width: 100%" border ref="subTable1Ref" @selection-change="subTable1Selected">
          <el-table-column type="selection" width="35" />
          <el-table-column prop="a" label="路线编号" />
          <el-table-column prop="b" label="路线名称" />
          <el-table-column prop="c" label="备注" />
        </el-table>
        <el-pagination small background layout="prev, pager, next" :total="200000">
        </el-pagination>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairDialog1SureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog1CalcBtn()">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框里的弹框2：执行人列表 -->
    <div v-dialogdrag class="pop-2">
      <el-dialog v-model="repairDialog2" title="执行人列表" width="60%" @close="repairDialog2Close(row)" :rules="repairForm2Rules">
        <el-form ref="repairForm2Ref" :model="repairForm2" label-width="50px" size="small">
          <el-form-item label="搜索" prop="search" style="width: 50%">
            <el-input v-model="repairForm2.search"></el-input>
          </el-form-item>
        </el-form>
        <el-table :data="subTable2" style="width: 100%" border ref="subTable2Ref" @selection-change="subTable2Selected">
          <el-table-column type="selection" width="35" />
          <el-table-column prop="a" label="姓名" />
          <el-table-column prop="b" label="部门" />
          <el-table-column prop="c" label="职位" />
          <el-table-column prop="d" label="电话" />
        </el-table>
        <el-pagination small background layout="prev, pager, next" :total="200000">
        </el-pagination>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairDialog2SureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog2CalcBtn()">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框：查看 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog3" title="查看" width="50%" @close="repairDialog3Close">
        <div class="dialog-border">
          <el-form label-width="110px" :model="repairForm3" ref="repairForm3Ref" :rules="repairForm3Rules" size="small">
            <div class="row-1">
              <el-form-item label="计划编码" prop="no" style="width:100%">
                <el-input v-model="repairForm.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="计划名称" prop="type" style="width:100%">
                <el-input v-model="repairForm.type" readonly></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="巡检部门" prop="no" style="width:100%">
                <el-input v-model="repairForm.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="负责人" prop="type" style="width:100%">
                <el-input v-model="repairForm.type" readonly></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="预计开始时间" prop="no">
                <el-date-picker v-model="repairForm.no" type="date" readonly></el-date-picker>
              </el-form-item>
              <el-form-item label="预计结束时间" prop="type" style="width:100%">
                <el-date-picker v-model="repairForm.type" type="date" readonly></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="周期间隔" prop="no" style="width:100%">
                <el-input v-model="repairForm.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="周期单位" prop="type" style="width:100%">
                <el-input v-model="repairForm.type" readonly>
                </el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="有效时长(小时)" prop="no" style="width:100%">
                <el-input v-model="repairForm.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="开始时刻" prop="type" style="width:100%">
                <el-select v-model="repairForm.type">
                  <el-option label="全天" value="1"></el-option>
                  <el-option label="一日多次" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="备注" prop="mark" style="width:100%">
                <el-input v-model="repairForm.mark" type="textarea" :rows="1" readonly></el-input>
              </el-form-item>
            </div>
          </el-form>
          <div class="dialog-border-padding">
            <div style="padding: 1vh 0;text-align:center">已选路线</div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="路线编码" />
              <el-table-column prop="b" label="路线名称" />
              <el-table-column prop="c" label="备注" />
              <el-table-column label="操作" width="80">
                <template #default>
                  <el-button type="success" size="mini">查看</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div style="padding: 1vh 0;text-align:center;margin-top:5vh">已选执行人</div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="姓名" />
              <el-table-column prop="b" label="工号" />
              <el-table-column prop="c" label="联系电话" />
              <el-table-column label="操作" width="80">
                <template #default></template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="info" size="mini" @click="repairDialog3 = false">关闭</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框：编辑 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog4" title="编辑" width="50%" @close="repairDialog4Close">
        <div class="dialog-border">
          <el-form label-width="110px" :model="repairForm4" ref="repairForm4Ref" :rules="repairForm4Rules" size="small">
            <div class="row-1">
              <el-form-item label="计划编码" prop="no" style="width:100%">
                <el-input v-model="repairForm4.no"></el-input>
              </el-form-item>
              <el-form-item label="计划名称" prop="type" style="width:100%">
                <el-input v-model="repairForm4.type"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="巡检部门" prop="no" style="width:100%">
                <el-select v-model="repairForm4.no">
                  <el-option label="部门1" value="1"></el-option>
                  <el-option label="部门2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="负责人" prop="type" style="width:100%">
                <el-input v-model="repairForm4.type"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="预计开始时间" prop="no">
                <el-date-picker v-model="repairForm4.no" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="预计结束时间" prop="type" style="width:100%">
                <el-date-picker v-model="repairForm4.type" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="周期间隔" prop="no" style="width:100%">
                <el-input v-model="repairForm4.no"></el-input>
              </el-form-item>
              <el-form-item label="周期单位" prop="type" style="width:100%">
                <el-select v-model="repairForm4.type">
                  <el-option label="日" value="1"></el-option>
                  <el-option label="周" value="2"></el-option>
                  <el-option label="月" value="3"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="有效时长(小时)" prop="no" style="width:100%">
                <el-input v-model="repairForm4.no"></el-input>
              </el-form-item>
              <el-form-item label="开始时刻" prop="type" style="width:100%">
                <el-select v-model="repairForm4.type">
                  <el-option label="全天" value="1"></el-option>
                  <el-option label="一日多次" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="备注" prop="mark" style="width:100%">
                <el-input v-model="repairForm4.mark" type="textarea" :rows="1"></el-input>
              </el-form-item>
            </div>
          </el-form>
          <div class="dialog-border-padding">
            <div style="padding: 1vh 0;text-align:center">已选路线</div>
            <div style="position:relative">
              <el-button type="primary" size="mini" style="position:absolute;right:0vw;bottom:0.5vh" @click="repairDialog1=true">增加</el-button>
            </div>
            <el-table :data="tableData" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="路线编码" />
              <el-table-column prop="b" label="路线名称" />
              <el-table-column prop="c" label="备注" />
              <el-table-column label="操作" width="140">
                <template #default>
                  <el-button type="success" size="mini">查看</el-button>
                  <el-button type="danger" size="mini">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div style="padding: 1vh 0;text-align:center;margin-top:5vh">已选执行人</div>
            <div style="position:relative">
              <el-button type="primary" size="mini" style="position:absolute;right:0vw;bottom:0.5vh" @click="repairDialog2=true">增加</el-button>
            </div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="姓名" />
              <el-table-column prop="b" label="工号" />
              <el-table-column prop="d" label="联系电话" />
              <el-table-column label="操作" width="80">
                <template #default>
                  <el-button type="danger" size="mini">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairSure4Btn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog4 = false">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框：排班 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog5" title="排班" width="50%" @close="repairDialog5Close">
        <div class="dialog-border">
          <el-form label-width="110px" :model="repairForm5" ref="repairForm5Ref" :rules="repairForm5Rules" size="small">
            <div class="row-1">
              <el-form-item label="计划编码" prop="no" style="width:100%">
                <el-input v-model="repairForm5.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="计划名称" prop="type" style="width:100%">
                <el-input v-model="repairForm5.type" readonly></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="巡检部门" prop="no" style="width:100%">
                <el-input v-model="repairForm5.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="负责人" prop="type" style="width:100%">
                <el-input v-model="repairForm5.type" readonly></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="预计开始时间" prop="no">
                <el-date-picker v-model="repairForm5.no" type="date" readonly></el-date-picker>
              </el-form-item>
              <el-form-item label="预计结束时间" prop="type" style="width:100%">
                <el-date-picker v-model="repairForm5.type" type="date" readonly></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="周期间隔" prop="no" style="width:100%">
                <el-input v-model="repairForm5.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="周期单位" prop="type" style="width:100%">
                <el-input v-model="repairForm5.type" readonly>
                </el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="有效时长(小时)" prop="no" style="width:100%">
                <el-input v-model="repairForm5.no" readonly></el-input>
              </el-form-item>
              <el-form-item label="开始时刻" prop="type" style="width:100%">
                <el-select v-model="repairForm5.type">
                  <el-option label="全天" value="1"></el-option>
                  <el-option label="一日多次" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="备注" prop="mark" style="width:100%">
                <el-input v-model="repairForm5.mark" type="textarea" :rows="1" readonly></el-input>
              </el-form-item>
            </div>
          </el-form>
          <div class="dialog-border-padding">
            <div style="padding: 1vh 0;text-align:center">已选路线</div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="路线编码" />
              <el-table-column prop="b" label="路线名称" />
              <el-table-column prop="c" label="备注" />
              <el-table-column label="操作" width="80">
                <template #default>
                  <el-button type="success" size="mini">查看</el-button>
                </template>
              </el-table-column>
            </el-table>
            <!-- 排班 -->
            <el-form label-width="110px" :model="repairForm5" ref="repairForm5Ref" :rules="repairForm5Rules" size="small" style="margin-top:5vh">
              <div class="row-1 paiban">
                <el-form-item label="排班开始时间" prop="no">
                  <el-date-picker v-model="repairForm5.no" type="date" readonly style="width:100%"></el-date-picker>
                </el-form-item>
                <el-form-item label="排班结束时间" prop="type" style="margin-left:3vw">
                  <el-date-picker v-model="repairForm5.type" type="date" readonly style="width:100%;"></el-date-picker>
                </el-form-item>
                <el-form-item>
                  <el-button type="danger" size="mini" @click="isShow = !isShow">历史排班</el-button>
                </el-form-item>
              </div>
            </el-form>
            <div v-show="isShow">
              <div style="padding: 0.2vh 0;text-align:center;">排班记录</div>
              <el-table :data="tableData3" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
                <el-table-column prop="a" label="编码" />
                <el-table-column prop="b" label="名称" />
                <el-table-column prop="c" label="开始时间" />
                <el-table-column prop="d" label="结束时间" />
                <el-table-column prop="e" label="周期" />
                <el-table-column prop="f" label="单位" />
                <el-table-column label="操作" width="95">
                  <template #default>
                    <el-button type="success" size="mini" @click="repairDialog6 = true">执行人</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <!-- 执行人 -->
            <div style="padding: 1vh 0;text-align:center;margin-top:5vh">已选执行人</div>
            <div style="position:relative">
              <el-button type="primary" size="mini" style="position:absolute;right:0vw;bottom:0.5vh" @click="repairDialog2=true">增加</el-button>
            </div>
            <el-table :data="tableData2" style="width: 100%" border :default-sort="{ prop: 'a', order: 'ascending' }">
              <el-table-column prop="a" label="姓名" />
              <el-table-column prop="b" label="工号" />
              <el-table-column prop="c" label="联系电话" />
              <el-table-column label="操作" width="80">
                <template #default>
                  <el-button type="danger" size="mini">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairDialog5SureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog5 = false">关闭</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框里的弹框2：排班里的执行人 -->
    <div v-dialogdrag class="pop-2">
      <el-dialog v-model="repairDialog6" title="执行人" width="40%" @close="repairDialog6Close" :rules="repairForm6Rules">
        <el-table :data="subTable2" style="width: 100%" border>
          <el-table-column prop="a" label="姓名" />
          <el-table-column prop="e" label="工号" />
          <el-table-column prop="d" label="电话" />
        </el-table>
        <el-pagination small background layout="prev, pager, next" :total="200000">
        </el-pagination>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairDialog6SureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog6=false">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

  </div>
</template>

<script>
import Header from "@/components/Header";
import moment from "moment";
import LInput from "../../../components/LInput.vue";
import LDateTimeSelect2 from "../../../components/LDateTimeSelect2.vue";
import LButton from "../../../components/LButton.vue";
import LSelect from "@/components/LSelect.vue";

export default {
  components: {
    Header,
    LInput,
    LDateTimeSelect2,
    LButton,
    LSelect,
  },
  data() {
    return {
      name: "",
      type: "1",
      option1: [
        {
          value: "1",
          label: "全部",
        },
        {
          value: "2",
          label: "启用",
        },
        {
          value: "3",
          label: "停用",
        },
      ],
      tData: [
        {
          a: "DIP21070119503592",
          b: "空调巡检",
          c: "工程部",
          d: "孟凡凯",
          e: "2020-07-01",
          f: "2019-12-31",
        },
        {
          a: "AIP21070119503592",
          b: "空调巡检",
          c: "工程部",
          d: "孟凡凯",
          e: "2021-07-01",
          f: "2021-12-31",
        },
        {
          a: "BIP21070119503592",
          b: "空调巡检",
          c: "工程部",
          d: "孟凡凯",
          e: "2017-07-01",
          f: "2017-12-31",
        },
      ],
      //=======================================
      repairDialog: false,
      repairForm: {},
      tableData: [
        // {
        //   a: "00",
        //   b: "检查机组运行噪声",
        //   c: "运行声音或震动是否正常",
        //   d: "是/否",
        // },
      ],
      tableData2: [],
      isShow: false,
      tableData3: [
        {
          a: "11111",
          b: "11111",
          c: "11111",
          d: "11111",
          e: "11111",
          f: "11111",
          g: "11111",
        },
      ],
      //==============================================
      repairDialog1: false,
      repairForm1: {},
      subTable1: [
        {
          a: "1",
          b: "1",
          c: "1",
        },
        {
          a: "2",
          b: "2",
          c: "2",
        },
      ],
      subTable1Select: null, //声明一个变量保存"路线列表"的值
      //==============================================
      repairDialog2: false,
      repairForm2: {},
      subTable2: [
        {
          a: "1",
          b: "1",
          c: "1",
          d: "1",
          e: "1",
        },
        {
          a: "2姓名",
          b: "2部门",
          c: "2职位",
          d: "2电话",
          e: "工号2",
        },
      ],
      subTable2Select: null, //声明一个变量保存"执行人"的值
      //==============================================
      repairDialog3: false,
      repairForm3: {},
      repairDialog4: false,
      repairForm4: {},
      repairDialog5: false,
      repairForm5: {},
      repairDialog6: false,
      repairForm6: {},
    };
  },
  mounted() {},
  beforeUnmount() {},
  methods: {
    //下拉框 子传父
    getNewSelected(m) {
      this.type = m;
    },
    //清空筛选条件
    clearSelected() {
      console.log("点击清空按钮");
      this.name = "";
      this.type = "1";
    },
    //===================================================
    toogleExpand(row) {
      console.log(row);
      let $table = this.$refs.table;
      // this.tData.map((item) => {
      //   if (row.id != item.id) {
      //     $table.toggleRowExpansion(item, false);
      //   }
      // });
      $table.toggleRowExpansion(row);
    },
    //===================================================
    //“新增”窗口清空内容功能
    repairDialogClose() {
      this.$refs.repairFormRef.resetFields();
      this.tableData = [];
      this.tableData2 = [];
    },
    //“新增”窗口"路线列表"当前选择值
    subTable1Selected(val) {
      console.log("选中项打印：", val);
      this.subTable1Select = val;
    },
    //“新增”窗口"路线列表"清除当前选择值
    repairDialog1Close(rows) {
      this.$refs.repairForm1Ref.resetFields();
      if (rows) {
        rows.forEach((row) => {
          this.$refs.subTable1Ref.toggleRowSelection(row);
        });
      } else {
        this.$refs.subTable1Ref.clearSelection();
      }
    },
    // “新增”窗口"路线列表"后“关闭”按钮
    repairDialog1CalcBtn(rows) {
      this.$refs.repairForm1Ref.resetFields();
      if (rows) {
        rows.forEach((row) => {
          this.$refs.subTable1Ref.toggleRowSelection(row);
        });
      } else {
        this.$refs.subTable1Ref.clearSelection();
      }
      this.repairDialog1 = false;
    },
    //“新增”窗口"设备路线列表"后“确认”按钮
    repairDialog1SureBtn() {
      this.repairDialog1 = false;
      this.tableData.push(...this.subTable1Select);
      console.log("this.tableData2", this.tableData2);
    },
    //===================================================
    //“新增”窗口"执行人列表"当前选择值
    subTable2Selected(val) {
      console.log("选中项打印：", val);
      this.subTable2Select = val;
    },
    //“新增”窗口"执行人列表"清除当前选择值
    repairDialog2Close(rows) {
      this.$refs.repairForm2Ref.resetFields();
      if (rows) {
        rows.forEach((row) => {
          this.$refs.subTable2Ref.toggleRowSelection(row);
        });
      } else {
        this.$refs.subTable2Ref.clearSelection();
      }
    },
    // “新增”窗口"执行人列表"后“关闭”按钮
    repairDialog2CalcBtn(rows) {
      this.$refs.repairForm2Ref.resetFields();
      if (rows) {
        rows.forEach((row) => {
          this.$refs.subTable2Ref.toggleRowSelection(row);
        });
      } else {
        this.$refs.subTable2Ref.clearSelection();
      }
      this.repairDialog2 = false;
    },
    //“新增”窗口"执行人列表"后“确认”按钮
    repairDialog2SureBtn() {
      this.repairDialog2 = false;
      this.tableData2.push(...this.subTable2Select);
      console.log("this.tableData2", this.tableData2);
    },
    //===================================================
    //“编辑”窗口清空内容功能
    repairDialog4Close() {
      this.$refs.repairForm4Ref.resetFields();
      this.tableData = [];
      this.tableData2 = [];
    },
    //===================================================
    //停用数据按钮
    stop() {
      this.$confirm("此操作将停用该计划, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          // post("/airChannel/deleteAirChannel", { id: id }).then((res) => {
          //   // console.log(res);
          //   if (res.data.code == 200) {
          //     this.$message.success(res.data.data);
          //     this.getData();
          //   } else {
          //     this.$message.error(res.data.data);
          //   }
          // });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消停用",
          });
        });
    },
    //删除数据按钮
    del() {
      this.$confirm("此操作将删除该信息, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          // post("/airChannel/deleteAirChannel", { id: id }).then((res) => {
          //   // console.log(res);
          //   if (res.data.code == 200) {
          //     this.$message.success(res.data.data);
          //     this.getData();
          //   } else {
          //     this.$message.error(res.data.data);
          //   }
          // });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
  },
};
</script>

<style lang="less" scoped>
@import "../opera.less";

.search_bar {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.row-1 {
  display: flex;
  justify-content: space-between;
  padding: 0 2vw 0 0;
}

/deep/ .el-dialog .el-select {
  width: 322px;
}

/deep/ .el-date-editor.el-input {
  width: 322px;
}

.paiban {
  /deep/.el-date-picker {
    // width: 100px;
  }
}
</style>
